#pragma once
#include <d3d12.h>
#include <wrl/client.h>
#include "../../Utility/Predeclare.h"

using Microsoft::WRL::ComPtr;

class D3D12DescHeapManager
{
public:
	D3D12DescHeapManager();
	~D3D12DescHeapManager();

	_hr SetUp(ID3D12Device* pDevice,UINT numRtvDesc,UINT numDestDesc,UINT numCsvDesc);
	
	D3D12_CPU_DESCRIPTOR_HANDLE GetDescHandleCPU(D3D12_DESCRIPTOR_HEAP_TYPE type,UINT offset);
	D3D12_GPU_DESCRIPTOR_HANDLE GetDescHandleGPU(D3D12_DESCRIPTOR_HEAP_TYPE type, UINT offset);

	UINT AlloctDescHandle(D3D12_DESCRIPTOR_HEAP_TYPE type, UINT num,D3D12_GPU_DESCRIPTOR_HANDLE* pGpuHandleStart, D3D12_CPU_DESCRIPTOR_HANDLE* pCpuHandleStart);

protected:
	ComPtr<ID3D12DescriptorHeap> m_rtvHeap;
	UINT m_rtvDescSize;
	UINT m_rtvHeapSize;
	UINT m_rtvCurrentPos;
	ComPtr<ID3D12DescriptorHeap> m_dstHeap;
	UINT m_dstDescSize;
	UINT m_dstHeapSize;
	UINT m_dstCurrentPos;
	ComPtr<ID3D12DescriptorHeap> m_csvHeap;
	UINT m_csvDescSize;
	UINT m_csvHeapSize;
	UINT m_csvCurrentPos;

};

